-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add NAS Identifier attribute to radius request #5465
Conversation
In our company we use Radius NAS Identifier attribute to access control in different teams. It would be nice if you accept PR. |
@DrGonzo we'll get to it, don't worry :-) |
@@ -144,6 +144,9 @@ func (b *backend) RadiusLogin(ctx context.Context, req *logical.Request, usernam | |||
packet := radius.New(radius.CodeAccessRequest, []byte(cfg.Secret)) | |||
UserName_SetString(packet, username) | |||
UserPassword_SetString(packet, password) | |||
if cfg.NasIdentifier != "" { | |||
NASIdentifier_AddString(packet, cfg.NasIdentifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that some of the other variables are choosing Set
functions, is there a reason for choosing NASIdentifier_AddString
over NASIdentifier_SetString
? Will add
ing allocate the space needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Add allows multiple. I don't think it matters here though since we're only supporting a single identifier (at least for now). But if we ever supported more than one we'd need to iterate over and use Add, so makes sense to keep it in for now I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment. Otherwise LGTM!
@meirish Could you please 👍 the JS changes? |
I actually asked him the other day out-of-band and he said they were good. |
No description provided.